//
//  TempPicModel.swift
//  ANOA
//
//  Created by 邱仙凯 on 2024/10/24.
//  Copyright © 2024 zwb. All rights reserved.
//

import Foundation
import ObjectMapper
import Photos

public class TempPicModel: Mappable  {
    
    // MARK: Declaration for string constants to be used to decode and also serialize.
    private struct SerializationKeys {
        static let zOrderCd = "z_order_cd"
        static let zPicName = "z_pic_name"
        static let zUpdateDt = "z_update_dt"
        static let zPhoneType = "z_phone_type"
        static let vouId = "vou_id"
        static let zUpdaterNm = "z_updater_nm"
        static let zIsPic = "z_is_pic"
        static let idKey = "id_key"
        static let zIsMobile = "z_is_mobile"
        static let zUpdaterId = "z_updater_id"
        static let zPicUrl = "z_pic_url"
        static let zOrgId = "z_org_id"
        static let zType = "z_type"
        static let zFileType = "z_file_type"
        static let zOptDt = "z_opt_dt"
        static let c_type = "c_type"
        static let clipName = "clip_name"
        static let complete = "complete"
    }
    
    // MARK: Properties
    public var zOrderCd: String?
    public var zPicName: String?
    public var zUpdateDt: String?
    public var zPhoneType: String?
    public var vouId: Int?
    public var zUpdaterNm: String?
    public var zIsPic: String?
    public var idKey: String?
    public var zIsMobile: Int?
    public var zUpdaterId: Int?
    public var zPicUrl: String?
    public var zOrgId: Int?
    public var zType: String?
    public var zFileType: String?
    public var zOptDt: String?
    public var image:UIImage?
    public var asset:PHAsset?
    public var imageTp:ImageSourType?

 
    public var sType: String?
  
    public var c_type: String?

    public var clipName: String?
    public var complete: Int?
 
    // MARK: ObjectMapper Initializers
    /// Map a JSON object to this class using ObjectMapper.
    ///
    /// - parameter map: A mapping from ObjectMapper.
    public required init?(map: Map){
        
    }
    
    /// Map a JSON object to this class using ObjectMapper.
    ///
    /// - parameter map: A mapping from ObjectMapper.
    public func mapping(map: Map) {
 
        zOrderCd <- map[SerializationKeys.zOrderCd]
        zPicName <- map[SerializationKeys.zPicName]
        zUpdateDt <- map[SerializationKeys.zUpdateDt]
        zPhoneType <- map[SerializationKeys.zPhoneType]
        vouId <- map[SerializationKeys.vouId]
        zUpdaterNm <- map[SerializationKeys.zUpdaterNm]
        zIsPic <- map[SerializationKeys.zIsPic]
        idKey <- (map[SerializationKeys.idKey],StringTransform())
        zIsMobile <- map[SerializationKeys.zIsMobile]
        zUpdaterId <- map[SerializationKeys.zUpdaterId]
        zPicUrl <- map[SerializationKeys.zPicUrl]
    
        
        zOrgId <- map[SerializationKeys.zOrgId]
        zType <- map[SerializationKeys.zType]
        zFileType <- map[SerializationKeys.zFileType]
        zOptDt <- map[SerializationKeys.zOptDt]
        
        c_type <- (map[SerializationKeys.c_type],StringTransform())

        clipName <- (map[SerializationKeys.clipName])
        complete <- (map[SerializationKeys.complete])
    }
    
    /// Generates description of the object in the form of a NSDictionary.
    ///
    /// - returns: A Key value pair containing all valid values in the object.
    public func dictionaryRepresentation() -> [String: Any] {
        var dictionary: [String: Any] = [:]
        if let value = zOrderCd { dictionary[SerializationKeys.zOrderCd] = value }
        if let value = zPicName { dictionary[SerializationKeys.zPicName] = value }
        if let value = zUpdateDt { dictionary[SerializationKeys.zUpdateDt] = value }
        if let value = zPhoneType { dictionary[SerializationKeys.zPhoneType] = value }
        if let value = vouId { dictionary[SerializationKeys.vouId] = value }
        if let value = zUpdaterNm { dictionary[SerializationKeys.zUpdaterNm] = value }
        if let value = zIsPic { dictionary[SerializationKeys.zIsPic] = value }
        if let value = idKey { dictionary[SerializationKeys.idKey] = value }
        if let value = zIsMobile { dictionary[SerializationKeys.zIsMobile] = value }
        if let value = zUpdaterId { dictionary[SerializationKeys.zUpdaterId] = value }
        if let value = zPicUrl { dictionary[SerializationKeys.zPicUrl] = value }
        if let value = zOrgId { dictionary[SerializationKeys.zOrgId] = value }
        if let value = zType { dictionary[SerializationKeys.zType] = value }
        if let value = zFileType { dictionary[SerializationKeys.zFileType] = value }
        if let value = zOptDt { dictionary[SerializationKeys.zOptDt] = value }
        if let value = clipName { dictionary[SerializationKeys.clipName] = value }
        if let value = complete { dictionary[SerializationKeys.complete] = value }
       
        return dictionary
    }
    
    
}
